#ifndef MAIN_H
#define MAIN_H


#include <QPushButton>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QStackedLayout>
#include <QListWidget>
#include <QWidget>
#include "my_lineedit.h"
#include "func_widget.h"
#include <QCheckBox>
#include "ada_parm_data_set.h"
#include <QButtonGroup>
#include <QRadioButton>
#include <QCheckBox>
#include <QGroupbox>

#include "time.h"
#include "sys/timeb.h"
#include "my_checkbox.h"
#include "user_textedit.h"

//#define SLAVE_NUM_CURRENT (28)
#define SLAVE_NUM (32)

using namespace std;

struct master_state_summary
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class my_lineedit*  master_state;
    class my_lineedit*  commander_comm_err;
    class my_lineedit*  master_brake;
};





struct laser_parm_summary
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class my_lineedit*  power_state;
    class my_lineedit*  mo1_current;
    class my_lineedit*  mo1_state;

    class my_lineedit*  mo2_current;
    class my_lineedit*  mo2_state;

    class my_lineedit*  fa1_current;
    class my_lineedit*  fa1_state;

    class my_lineedit*  fa2_current;
    class my_lineedit*  fa2_state;

    class my_lineedit*  work_state;
    class my_lineedit*  pd1;
    class my_lineedit*  pd2;
    class my_lineedit*  pd3;
    class my_lineedit*  pd4;

    class my_lineedit*  t1;
    class my_lineedit*  t2;
    class my_lineedit*  t3;
    class my_lineedit*  t4;
    class my_lineedit*  humidity;
    class my_lineedit*  temperature;
    class my_lineedit*  intensity;
    class my_lineedit*  err_code1;
    class my_lineedit*  err_code2;
    class my_lineedit*  err_code3;
    class my_lineedit*  running_state;
    class my_lineedit*  echo;
    class my_lineedit*  mod;
    class my_lineedit*  mt_temperature;
    class my_lineedit*  ast_temperature;
};



struct master_adaptor_parm_widget_summary
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class QPushButton*  button_ada_parm;
    class my_checkbox*  slave_mount[SLAVE_NUM];
    class my_checkbox*  brake_enable;
    class my_checkbox*  commander_comm_enable;
};



struct adaptor_paramter_wedget_summary
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;

    class my_lineedit*  week1_mo1_current;
    class my_lineedit*  week1_mo2_current;
    class my_lineedit*  week1_fa1_current;
    class my_lineedit*  week1_fa2_current;

    class my_lineedit*  week2_mo1_current;
    class my_lineedit*  week2_mo2_current;
    class my_lineedit*  week2_fa1_current;
    class my_lineedit*  week2_fa2_current;

    class my_lineedit*  strong_mo1_current;
    class my_lineedit*  strong_mo2_current;
    class my_lineedit*  strong_fa1_current;
    class my_lineedit*  strong_fa2_current;

    class my_lineedit*  mo1_current_over_limit;
    class my_lineedit*  mo2_current_over_limit;
    class my_lineedit*  fa_current_over_limit;

    class my_lineedit*  can_address;
    class my_lineedit*  pd1_low_limit;
    class my_lineedit*  pd2_low_limit;
    class my_lineedit*  pd3_low_limit;
    class my_lineedit*  pd4_low_limit;
    class my_lineedit*  t1_over_limit;
    class my_lineedit*  t1_low_limit;
    class my_lineedit*  t2_over_limit;
    class my_lineedit*  t2_low_limit;
    class my_lineedit*  t3_over_limit;
    class my_lineedit*  t3_low_limit;
    class my_lineedit*  t4_over_limit;
    class my_lineedit*  t4_low_limit;
    class my_lineedit*  envi_temperature_over_limit;
    class my_lineedit*  envi_temperature_low_limit;
    class my_lineedit*  envi_humidity_over_limit;
    class my_lineedit*  wave_length;
    class my_lineedit*  expansion_module_id;
    class my_lineedit*  sn;

    class my_checkbox*  brake_enable;
    class my_checkbox*  power_comm_enable;
    class my_checkbox*  t1_enable;
    class my_checkbox*  t2_enable;
    class my_checkbox*  t3_enable;
    class my_checkbox*  t4_enable;
    class my_checkbox*  pd1_enable;
    class my_checkbox*  pd2_enable;
    class my_checkbox*  pd3_enable;
    class my_checkbox*  pd4_enable;

    class my_checkbox*  envi_temperature_enable;
    class my_checkbox*  envi_humidity_enable;
    class my_checkbox*  mo_current_enable;
    class my_checkbox*  fa_current_enable;
    class my_checkbox*  seq_enable;
    class my_checkbox*  master_comm_enable;
};


struct master_adaptor_set_parm_widget_summary
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class QPushButton*  button_parm_set;
    class QPushButton*  button_parm_store;
    class QPushButton*  button_parm_init;
    class my_checkbox*  slave_mount[SLAVE_NUM];
    class my_checkbox*  brake_enable;
    class my_checkbox*  commander_comm_enable;
};

struct adaptor_paramter_set_summary
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class QPushButton*  parm_set;
    class QPushButton*  parm_store;
    class QPushButton*  parm_init;
    class QPushButton*  parm_load;
    class my_lineedit*  slave_id;
    class my_lineedit*  week1_mo1_current;
    class my_lineedit*  week1_mo2_current;
    class my_lineedit*  week1_fa1_current;
    class my_lineedit*  week1_fa2_current;

    class my_lineedit*  week2_mo1_current;
    class my_lineedit*  week2_mo2_current;
    class my_lineedit*  week2_fa1_current;
    class my_lineedit*  week2_fa2_current;

    class my_lineedit*  strong_mo1_current;
    class my_lineedit*  strong_mo2_current;
    class my_lineedit*  strong_fa1_current;
    class my_lineedit*  strong_fa2_current;

    class my_lineedit*  mo1_current_over_limit;
    class my_lineedit*  mo2_current_over_limit;
    class my_lineedit*  fa_current_over_limit;

    class my_lineedit*  can_address;
    class my_lineedit*  pd1_low_limit;
    class my_lineedit*  pd2_low_limit;
    class my_lineedit*  pd3_low_limit;
    class my_lineedit*  pd4_low_limit;
    class my_lineedit*  t1_over_limit;
    class my_lineedit*  t1_low_limit;
    class my_lineedit*  t2_over_limit;
    class my_lineedit*  t2_low_limit;
    class my_lineedit*  t3_over_limit;
    class my_lineedit*  t3_low_limit;
    class my_lineedit*  t4_over_limit;
    class my_lineedit*  t4_low_limit;
    class my_lineedit*  envi_temperature_over_limit;
    class my_lineedit*  envi_temperature_low_limit;
    class my_lineedit*  envi_humidity_over_limit;
    class my_lineedit*  wave_length;
    class my_lineedit*  expansion_module_id;
    class my_lineedit*  sn;

    class my_checkbox*  brake_enable;
    class my_checkbox*  power_comm_enable;
    class my_checkbox*  t1_enable;
    class my_checkbox*  t2_enable;
    class my_checkbox*  t3_enable;
    class my_checkbox*  t4_enable;
    class my_checkbox*  pd1_enable;
    class my_checkbox*  pd2_enable;

    class my_checkbox*  pd3_enable;
    class my_checkbox*  pd4_enable;
    class my_checkbox*  envi_temperature_enable;
    class my_checkbox*  envi_humidity_enable;
    class my_checkbox*  mo_current_enable;
    class my_checkbox*  fa_current_enable;
    class my_checkbox*  seq_enable;
    class my_checkbox*  master_comm_enable;
};

struct mount_widget
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;

    class my_checkbox*  slave_mount[SLAVE_NUM];

};



struct my_lineedit_summary_5
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class QPushButton*  button1;
    class my_lineedit*  lineedit_1;
};

struct my_lineedit_summary_6
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class QPushButton*  button1;

};

struct my_lineedit_summary_7
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class QPushButton*  button1;
    class QPushButton*  button2;
};

struct my_lineedit_summary_8
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class QPushButton*  button1;
    class QPushButton*  button2;
    class QPushButton*  button3;
};


struct my_lineedit_summary_10
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class QPushButton*  button1;
    class QPushButton*  button2;
    class QPushButton*  button3;
    class QCheckBox*    checkbox1;
    class QCheckBox*    checkbox2;
    class QCheckBox*    checkbox3;
    class my_lineedit*  lineedit_1;
    class my_lineedit*  lineedit_2;
    class my_lineedit*  lineedit_3;
    class my_lineedit*  lineedit_4;
};

struct my_lineedit_summary_11
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class QPushButton*  button1;
};

struct my_lineedit_summary_12
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class QPushButton*  button1;
};

struct my_lineedit_summary_13
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class my_lineedit*  lineedit_1;
    class my_lineedit*  lineedit_2;
    class my_lineedit*  lineedit_3;
    class my_lineedit*  lineedit_4;
    class QPushButton*  button1;
    class QPushButton*  button2;
    class QPushButton*  connect;
    class QPushButton*  disconnect;
    class QPushButton*  operate_parm_upload_start;
    //class QPushButton*  alive_end;

};

struct my_lineedit_summary_14
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class QPushButton*  button1;
    //class QPushButton*  button2;
    class QPushButton*  button3;
    class QPushButton*  button4;
    class QPushButton*  button5;
};

//��Ӧ�Բ������ⲿ��
struct my_lineedit_summary_15
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class QPushButton*  button1;
    class QCheckBox*    checkbox1;
    class QCheckBox*    checkbox2;
    class QCheckBox*    checkbox3;
    class my_lineedit*  lineedit_1;
    class my_lineedit*  lineedit_2;
    class my_lineedit*  lineedit_3;
    class my_lineedit*  lineedit_4;
    class my_lineedit*  lineedit_5;
    class my_lineedit*  lineedit_6;
    class my_lineedit*  lineedit_7;
    class my_lineedit*  lineedit_8;
    class my_lineedit*  lineedit_9;
    class my_lineedit*  lineedit_10;
    class my_lineedit*  lineedit_11;
    class my_lineedit*  lineedit_12;
    class my_lineedit*  lineedit_13;
    class my_lineedit*  lineedit_14;
    class my_lineedit*  lineedit_15;
    class my_lineedit*  lineedit_16;
    class my_lineedit*  lineedit_17;
    class my_lineedit*  lineedit_18;
    class my_lineedit*  lineedit_19;
    class my_lineedit*  lineedit_20;
    class my_lineedit*  lineedit_21;
    class my_lineedit*  lineedit_22;
    class my_lineedit*  lineedit_23;
    class my_lineedit*  lineedit_24;
    class my_lineedit*  lineedit_25;
    class my_lineedit*  lineedit_26;
    class my_lineedit*  lineedit_27;
    class my_lineedit*  lineedit_28;
    class my_lineedit*  lineedit_29;
    class my_lineedit*  lineedit_30;
    class my_lineedit*  lineedit_31;

};

//��Ӧ�Բ������ø�����ģ�鲿��
struct my_lineedit_summary_16
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class my_lineedit*  lineedit_1;
    class my_lineedit*  lineedit_2;
    class my_lineedit*  lineedit_3;
    class my_lineedit*  lineedit_4;
    class my_lineedit*  lineedit_5;
    class my_lineedit*  lineedit_6;
    class my_lineedit*  lineedit_7;
    class my_lineedit*  lineedit_8;
    class my_lineedit*  lineedit_9;
    class my_lineedit*  lineedit_10;
    class my_lineedit*  lineedit_11;
    class my_lineedit*  lineedit_12;
    class my_lineedit*  lineedit_13;
    class my_lineedit*  lineedit_14;
    class my_lineedit*  lineedit_15;
    class my_lineedit*  lineedit_16;
    class my_lineedit*  lineedit_17;
    class my_lineedit*  lineedit_18;
    //class my_lineedit*  lineedit_19;

};




struct my_lineedit_summary_17
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class QCheckBox*    check_box;
    class my_lineedit*  lineedit_1;
    class my_lineedit*  lineedit_2;
    class my_lineedit*  lineedit_3;
    class my_lineedit*  lineedit_4;
    class my_lineedit*  lineedit_5;
    class my_lineedit*  lineedit_6;


};


struct my_lineedit_summary_18
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class QPushButton*  button1;
    class QPushButton*  button2;
};



struct operate_parm_widget
{
    class QWidget*      widget;
    class QVBoxLayout*  vboxlayout;
    class my_lineedit*  slave_state;
    class my_lineedit*  wave_length;

    class my_lineedit*  mo1_current;
    class my_lineedit*  mo1_state;

    class my_lineedit*  mo2_current;
    class my_lineedit*  mo2_state;

    class my_lineedit*  fa1_current;
    class my_lineedit*  fa1_state;

    class my_lineedit*  fa2_current;
    class my_lineedit*  fa2_state;

    class my_lineedit*  pd1;
    class my_lineedit*  pd2;
    class my_lineedit*  pd3;
    class my_lineedit*  pd4;

    class my_lineedit*  t1;
    class my_lineedit*  t2;
    class my_lineedit*  t3;
    class my_lineedit*  t4;

    class my_lineedit*  humidity;
    class my_lineedit*  intensity;
    class my_lineedit*  temperature;
    class my_lineedit*  running_state;
    class my_lineedit*  seed_source_state;
    class my_lineedit*  expansion_module_state;

    class my_lineedit*  err_code1;
    class my_lineedit*  err_code2;
    class my_lineedit*  err_code3;
    class my_lineedit*  expansion_module_id;
};







extern struct my_lineedit_summary_1 lineedit_summary_1;
extern struct my_lineedit_summary_2 lineedit_summary_2[5];

extern struct my_lineedit_summary_3 lineedit_summary_3;
extern struct my_lineedit_summary_4 lineedit_summary_4[5];

extern struct my_lineedit_summary_5 lineedit_summary_5;
extern struct my_lineedit_summary_6 lineedit_summary_6;

extern struct my_lineedit_summary_7 lineedit_summary_7;
extern struct my_lineedit_summary_8 lineedit_summary_8;
extern struct my_lineedit_summary_9 lineedit_summary_9;

extern struct my_lineedit_summary_10 lineedit_summary_10;

extern struct my_lineedit_summary_11 lineedit_summary_11;
extern struct my_lineedit_summary_12 lineedit_summary_12;

extern struct my_lineedit_summary_13 lineedit_summary_13;
extern struct my_lineedit_summary_14 lineedit_summary_14;
extern struct my_lineedit_summary_15 lineedit_summary_15;

extern struct my_lineedit_summary_16 lineedit_summary_16[5];
extern struct my_lineedit_summary_17 lineedit_summary_17[4];
extern struct my_lineedit_summary_18 lineedit_summary_18;


extern QPushButton* start_pump_send;
extern user_textedit* my_textedit_1;
extern my_checkbox* show_parm_cmd_checkbox;

extern struct master_state_summary master_state;
extern struct operate_parm_widget slave_operate_parm[SLAVE_NUM];

extern struct adaptor_paramter_wedget_summary adaptor_parm_summary[SLAVE_NUM];
extern struct adaptor_paramter_set_summary adaptor_parm_set_summary;
extern struct mount_widget slave_mount_widget;
extern struct master_adaptor_parm_widget_summary master_adaptor_parm_widget;
extern struct master_adaptor_set_parm_widget_summary master_adaptor_set_parm_widget;
#endif // MAIN_H
